package com.yunupmall.service.admin.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunupmall.api.fordentity.Image;
import com.yunupmall.mapper.commoditymapper.ImageMapper;
import com.yunupmall.service.admin.service.ImageService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class Imageimpl extends ServiceImpl<ImageMapper, Image> implements ImageService {

    @Override
    public Image getList() {
        Image byId = this.getById(1);
        return byId;
    }

    @Override
    @Transactional
    public String updateData(Image image) {
        image.setId(1);
        if (this.updateById(image)){
            return "成功";
        }else {
            throw new RuntimeException("失败");
        }
    }
}
